//
//  UIViewController+Sheet.m
//  WHEasyBizLink
//
//  Created by ShengMeng on 9/26/25.
//

#import "UIViewController+Sheet.h"


@implementation UIViewController (Sheet)

- (void)showActionSheet {
    UIAlertController *actionSheet = [UIAlertController
                                     alertControllerWithTitle:@"12345678901"
                                     message:@""
                                     preferredStyle:UIAlertControllerStyleActionSheet];
    // 呼叫按钮
    UIAlertAction *takeAction = [UIAlertAction
                                   actionWithTitle:@"呼叫"
                                   style:UIAlertActionStyleDefault
                                   handler:^(UIAlertAction * _Nonnull action) {
    }];
    
    // 取消按钮
    UIAlertAction *cancelAction = [UIAlertAction
                                   actionWithTitle:@"取消"
                                   style:UIAlertActionStyleCancel
                                   handler:nil];
    
    [actionSheet addAction:takeAction];
    [actionSheet addAction:cancelAction];
    
//    // 对于 iPad，需要设置弹出位置
//    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
//        actionSheet.popoverPresentationController.sourceView = self.view;
//        actionSheet.popoverPresentationController.sourceRect = CGRectMake(self.view.bounds.size.width / 2.0,
//                                                                         self.view.bounds.size.height / 2.0,
//                                                                         1.0, 1.0);
//        actionSheet.popoverPresentationController.permittedArrowDirections = 0;
//    }
//
    [self presentViewController:actionSheet animated:YES completion:nil];
}

@end
